<?php
require_once ("../../config/config.php");
require_once ("../../config/constants.php");
require_once ("../../db/queries.php");
require_once ("../../common/common.php");

$entity = $_REQUEST["entity"];
$element = $_REQUEST["element"];
$count = $_REQUEST["count"];
$type = $_REQUEST["type"];

function findInDB($entity,$element,$count,$type) {
	if($count==''){
		$count=5;
	}
	$strQuery = "select u.uname,u.fname,u.lname,u.score,t.name from $dbname.users u, $dbname.team t where u.currentTeamId=t.Id order by u.score DESC LIMIT $count;";
	return generateResultSet($strQuery);
}

makeQueryXML(findInDB($entity,$element,$count,$type));
?>